package edu.uba.fcen.estimacion.estimacion;

import java.io.File;

import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
import org.apache.log4j.Logger;

public class TestOverGoldStandard {

	private static final Logger logger = Logger.getLogger(TestOverGoldStandard.class);
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String pathToCSV = args[0];
		String pathToGoldStandardDirectory = args[1];
		
		File directoryBase = new File(pathToGoldStandardDirectory);
		Estimacion estimacion = new Estimacion(pathToCSV);
		
		EstimacionData data;
		Means mean;
		
		for(File in : directoryBase.listFiles()) {
			data = estimacion.runOver(in.getAbsolutePath());
			mean = data.getMeans();
			Double valueStdev = Double.valueOf(mean.getStdevAgrado());
			Double valueMean = Double.valueOf(mean.getMeanAgrado());
			if (valueStdev.isNaN() || valueMean.isNaN()) {
				System.out.println("Es NaN: " + in.getAbsolutePath());
			} else {
				System.out.println(in.getName() + "\t " + data.getCoverage()*100 + "\t" + data.getMeans().printMedias());
			}
		}
	}

}
